Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TpmFailureMode: Add missing request size checks #105

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

DemiMarie
Copy link
Contributor

@DemiMarie DemiMarie commented Dec 9, 2023

This is harmless, but is inconsistent with the non-failure case.

The second commit doesn’t change the TPM’s observable behavior. However, when combined with the first commit, it would allow the bounds checks in TpmFail.c’s Unmarshal16() and Unmarshal32() to be omitted, or even replacing these functions with BYTE_ARRAY_TO_UINT16() and BYTE_ARRAY_TO_UINT32() respectively. I did not make this change as it would be a slightly larger refactor. I’m fine with keeping the second commit, dropping it entirely, or squashing it into the first commit.

This is harmless, but it is inconsistent with the non-failure case.
This doesn't change the observable behavior of the TPM.  However, when
combined with the previous commit ("TpmFailureMode: Add missing request
size checks"), it guarantees that the unmarshalling functions in
TpmFail.c always succeed and could be changed to return void, which
would simplify the code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant